package com.inspur.edp.ai.flow.engine;

import com.inspur.edp.ai.flow.exception.FlowException;

public enum MessageType {
    NULL("null"),
    STOP("stop"),
    FUNCTION_CALL("functionCall"),
    STATE("state");

    MessageType(String value) {
        this.value = value;
    }

    private final String value;
    public String getValue() {
        return value;
    }

    public static MessageType fromValue(String value) {
        for (MessageType type : MessageType.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        throw new FlowException("Invalid MessageType value: " + value);
    }
}
